/**
 * This file is part of MoChat.
 *
 * @link https://mo.chat
 * @document https://mochat.wiki
 * @contact group@mo.chat
 * @license https://github.com/mochat-cloud/mochat-java/blob/master/LICENSE
 */

package com.pactera.madp.cp.common.constant;

/**
 * @author: yangpengwei
 * @time: 2020/12/12 4:54 下午
 * @description 企业微信 api
 * <p>
 * 企业微信 api 访问地址: https://work.weixin.qq.com/api/doc/90000/90135/90664
 */
public interface WxApiConst {

    String API_BASE = "https://qyapi.weixin.qq.com/cgi-bin";

    /**
     * 微信 AccessToken url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET
     * <p>
     * corpid: 企业ID，获取方式参考：术语说明-corpid
     * corpsecret: 应用的凭证密钥，获取方式参考：术语说明-secret
     */
    String API_ACCESS_TOKEN = API_BASE + "/gettoken";

    /**
     * 微信 获取部门列表 url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token=ACCESS_TOKEN&id=ID
     * <p>
     * access_token: 调用接口凭证
     * id: 部门id。获取指定部门及其下的子部门（以及及子部门的子部门等等，递归）。 如果不填，默认获取全量组织架构
     */
    String API_DEPARTMENT_LIST = API_BASE + "/department/list";

    /**
     * 微信 创建部门 url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token=ACCESS_TOKEN&id=ID
     * <p>
     * access_token: 调用接口凭证
     */
    String API_DEPARTMENT_CREATE = API_BASE + "/department/create";

    /**
     * 微信 更新部门 url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/department/update?access_token=ACCESS_TOKEN&id=ID
     * <p>
     * access_token: 调用接口凭证
     */
    String API_DEPARTMENT_UPDATE = API_BASE + "/department/update";

    /**
     * 微信 删除部门 url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/department/delete?access_token=ACCESS_TOKEN&id=ID
     * <p>
     * access_token: 调用接口凭证
     */
    String API_DEPARTMENT_DELETE = API_BASE + "/department/delete";

    /**
     * 应用支持推送文本、图片、视频、文件、图文等类型 url
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/appchat/send?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_SEND_MSG = API_BASE + "/appchat/send";

    /**
     * 微信 获取部门成员详情 url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID&fetch_child=FETCH_CHILD
     * <p>
     * access_token: 调用接口凭证
     * department_id: 获取的部门id
     * fetch_child: 1/0：是否递归获取子部门下面的成员
     */
    String API_USER_LIST = API_BASE + "/user/list";

    /**
     * 微信 获取成员详情 url
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token=ACCESS_TOKEN&code=CODE
     * <p>
     * access_token: 调用接口凭证
     * code: 通过成员授权获取到的code，最大为512字节。每次成员授权带上的code将不一样，code只能使用一次，5分钟未被使用自动过期。
     */
    String API_USER_INFO = API_BASE + "/user/getuserinfo";

    /**
     * 微信 获取配置了客户联系功能的成员列表
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_follow_user_list?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_FOLLOW_USER_LIST = API_BASE + "/externalcontact/get_follow_user_list";

    /**
     * 微信 获取联系客户统计数据
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_user_behavior_data?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_USER_BEHAVIOR_DATA = API_BASE + "/externalcontact/get_user_behavior_data";

    /**
     * 微信 获取企业标签库
     * <p>
     * POST 请求地址:https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_corp_tag_list?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_GET_CORP_TAG_LIST = API_BASE + "/externalcontact/get_corp_tag_list";

    /**
     * 微信 添加企业客户标签
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_corp_tag?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_ADD_CORP_TAG = API_BASE + "/externalcontact/add_corp_tag";

    /**
     * 微信 编辑企业客户标签
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_corp_tag?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_EDIT_CORP_TAG = API_BASE + "/externalcontact/edit_corp_tag";

    /**
     * 微信 删除企业客户标签
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_corp_tag?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_DEL_CORP_TAG = API_BASE + "/externalcontact/del_corp_tag";

    /**
     * 微信 配置客户联系「联系我」方式
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_contact_way?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_ADD_CONTACT_WAY = API_BASE + "/externalcontact/add_contact_way";

    /**
     * 微信 更新客户联系「联系我」方式
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/update_contact_way?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_UPDATE_CONTACT_WAY = API_BASE + "/externalcontact/update_contact_way";

    /**
     * 微信 查询已存在客户联系「联系我」方式
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_contact_way?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_GET_CONTACT_WAY = API_BASE + "/externalcontact/get_contact_way";

    /**
     * 微信 获取客户群列表
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/list?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_GET_WORKROOM_LIST = API_BASE + "/externalcontact/groupchat/list";

    /**
     * 微信 获取客户群详情
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/groupchat/get?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_GET_WORKROOM_INFO = API_BASE + "/externalcontact/groupchat/get";

    /**
     * 微信 修改客户备注信息
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/remark?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_EDIT_EXTERNAL_REMARK = API_BASE + "/externalcontact/remark";

    /**
     * 微信 获取客户列表
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/externalcontact/list?access_token=ACCESS_TOKEN&userid=USERID
     * <p>
     * access_token: 调用接口凭证
     */
    String API_GET_EXTERNAL_LIST = API_BASE + "/externalcontact/list";


    /**
     * 微信 发送欢迎语
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/externalcontact/send_welcome_msg?access_token=ACCESS_TOKEN
     * <p>
     * access_token: 调用接口凭证
     */
    String API_ADD_WELCOME_MSG = API_BASE + "/externalcontact/send_welcome_msg";


    /**
     * 微信 获取客户详情
     * <p>
     * GET https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get?access_token=ACCESS_TOKEN&external_userid=EXTERNAL_USERID
     * <p>
     * access_token: 调用接口凭证
     */
    String API_GET_EXTERNAL_INFO = API_BASE + "/externalcontact/get";

    /**
     * 上传临时素材
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE
     * <p>
     * access_token: 调用接口凭证
     * type: 文件类型, 经测试可不传
     */
    String API_UPLOAD_FILE_TO_TEMP = API_BASE + "/media/upload";

    /**
     * 获取临时素材
     * <p>
     * POST https://qyapi.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
     * <p>
     * access_token: 调用接口凭证
     * media_id: 素材id
     */
    String API_GET_FILE_TO_TEMP = API_BASE + "/media/get";

    /**
     * 企业微信 - 获取指定的应用详情
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/agent/get?access_token=ACCESS_TOKEN&agentid=AGENTID
     */
    String API_GET_AGENT_INFO = API_BASE + "/agent/get";

    /**
     * 企业微信 - 获取企业的jsapi_ticket
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/get_jsapi_ticket?access_token=ACCESS_TOKEN
     */
    String API_GET_JSAPI_TICKET_CORP = API_BASE + "/get_jsapi_ticket";

    /**
     * 企业微信 - 获取应用的jsapi_ticket
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/ticket/get?access_token=ACCESS_TOKEN&type=agent_config
     */
    String API_GET_JSAPI_TICKET_APP = API_BASE + "/ticket/get";

    /**
     * 企业微信 - 获取应用的jsapi_ticket
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=ACCESS_TOKEN"
     */
    String API_ADD_MESSAGE = API_BASE + "/message/send?access_token=ACCESS_TOKEN";


    /**
     * 企业微信-获取群发记录列表
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_list_v2?access_token=ACCESS_TOKEN
     */
    String API_GET_GROUPMSG_LIST = API_BASE + "/externalcontact/get_groupmsg_list_v2";

    /**
     * 企业微信-获取群发成员发送任务列表
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_task?access_token=ACCESS_TOKEN
     */
    String API_GET_GROUPMSG_TASK = API_BASE + "/externalcontact/get_groupmsg_task";

    /**
     * 企业微信-获取企业群发成员执行结果
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_groupmsg_send_result?access_token=ACCESS_TOKEN
     */
    String API_GET_GROUPMSG_SEND_RESULT = API_BASE + "/externalcontact/get_groupmsg_send_result";
    /**
     * 企业微信-转接在职成员的客户给其他成员。
     */
    String API_POST_ON_INHERIT = API_BASE + "/externalcontact/transfer_customer";
    /**
     * 企业微信-查询在职成员的客户转接情况。
     */
    String API_POST_ON_USER_INHERIT = API_BASE + "/externalcontact/transfer_result";
    /**
     * 企业微信-获取待分配的离职成员列表。
     */
    String API_POST_RESIGNED_CONTACT_INHERIT = API_BASE + "/externalcontact/get_unassigned_list";
    /**
     * 企业微信-分配离职成员的客户。
     */
    String API_POST_RESIGNED_INHERIT = API_BASE + "/externalcontact/resigned/transfer_customer";
    /**
     * 企业微信-分配离职成员的客户群。
     */
    String API_POST_GROUP_RESIGNED_INHERIT = API_BASE + "/externalcontact/groupchat/transfer";
    /**
     * 企业微信-朋友圈列表
     */
    String API_POST_MOMENT_LIST = API_BASE + "/externalcontact/get_moment_list";
    /**
     * 企业微信- 企业发表的朋友圈的任务列表
     */
    String API_POST_MOMENT_TASK = API_BASE + "/externalcontact/get_moment_task";
    /**
     * 企业微信- 企业发表的朋友圈的评论和点赞情况
     */
    String API_POST_MOMENT_COMMENT = API_BASE + "/externalcontact/get_moment_comments";
    /**
     * 企业微信-读取成员
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN
     */
    String API_POST_USER_GET = API_BASE + "/user/get";
    /**
     * 企业微信-创建成员
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token=ACCESS_TOKEN
     */
    String API_POST_USER_CREATE = API_BASE + "/user/create";
    /**
     * 企业微信-更新成员
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=ACCESS_TOKEN
     */
    String API_POST_USER_UPDATE = API_BASE + "/user/update";
    /**
     * 企业微信-删除成员
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/user/delete?access_token=ACCESS_TOKEN
     */
    String API_POST_USER_DELETE = API_BASE + "/user/delete";
    /**
     * 企业微信-向群聊推送数据
     * https://qyapi.weixin.qq.com/cgi-bin/appchat/create?access_token=
     */
    String API_POST_GROUP_SEND = API_BASE + "/externalcontact/add_msg_template?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-朋友圈可见范围
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_moment_customer_list?access_token=ACCESS_TOKEN
     */
    String API_POST_MOMENT_RANGE = API_BASE + "/externalcontact/get_moment_customer_list?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服创建客服
     * https://qyapi.weixin.qq.com/cgi-bin/kf/account/add?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_CREATE = API_BASE + "/kf/account/add?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服删除客服
     * https://qyapi.weixin.qq.com/cgi-bin/kf/account/del?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_DELETE = API_BASE + "/kf/account/del?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服修改客服
     * https://qyapi.weixin.qq.com/cgi-bin/kf/account/update?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_UPDATE = API_BASE + "/kf/account/update?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服获取客服列表
     * https://qyapi.weixin.qq.com/cgi-bin/kf/account/list?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_LIST = API_BASE + "/kf/account/list?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服获取客服帐号链接
     * https://qyapi.weixin.qq.com/cgi-bin/kf/add_contact_way?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_ADD_CONTACT_WAY = API_BASE + "/kf/add_contact_way?access_token=ACCESS_TOKENn";
    /**
     * 企业微信-客服添加接待人员
     * https://qyapi.weixin.qq.com/cgi-bin/kf/servicer/add?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_SERVICER_ADD = API_BASE + "/kf/servicer/add?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服删除接待人员
     * https://qyapi.weixin.qq.com/cgi-bin/kf/servicer/del?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_SERVICER_DEL = API_BASE + "/kf/servicer/del?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服获取接待人员列表
     * https://qyapi.weixin.qq.com/cgi-bin/kf/servicer/list?access_token=ACCESS_TOKEN&open_kfid=XXX
     */
    String API_POST_KEFU_SERVICER_LIST = API_BASE + "/kf/servicer/list?access_token=ACCESS_TOKEN&open_kfid=XXX";
    /**
     * 企业微信-客服获取会话状态
     * https://qyapi.weixin.qq.com/cgi-bin/kf/service_state/get?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_SERVICE_STATUS = API_BASE + "/kf/service_state/get?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服接收消息和事件  读取消息
     * https://qyapi.weixin.qq.com/cgi-bin/kf/sync_msg?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_SYNC_MSG = API_BASE + "/kf/sync_msg?access_token=ACCESS_TOKEN";
    /**
     * 企业微信-客服当微信客户处于“新接入待处理”或“由智能助手接待”状态下，可调用该接口给用户发送消息。
     * https://qyapi.weixin.qq.com/cgi-bin/kf/send_msg?access_token=ACCESS_TOKEN
     */
    String API_POST_KEFU_SEND_MSG = API_BASE + "/kf/send_msg?access_token=ACCESS_TOKEN";


    /**
     * 创建群聊会话(内部群)
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/appchat/create?access_token=ACCESS_TOKEN
     * </P>
     * access_token	是	调用接口凭证
     * name	否	群聊名，最多50个utf8字符，超过将截断
     * owner	否	指定群主的id。如果不指定，系统会随机从userlist中选一人作为群主
     * userlist	是	群成员id列表。至少2人，至多2000人
     * chatid	否	群聊的唯一标志，不能与已有的群重复；字符串类型，最长32个字符。只允许字符0-9及字母a-zA-Z。如果不填，系统会随机生成群id
     */
    String API_POST_APPCHAT_CREATE = API_BASE + "/appchat/create";

    /**
     * 获取群聊会话(内部群)
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/appchat/get?access_token=ACCESS_TOKEN&chatid=CHATID
     * </p>
     * <p>
     * access_token	是	调用接口凭证
     * chatid	是	群聊id
     */

    String API_GET_APPCHAT_GET = API_BASE + "/appchat/get";


    /**
     * 修改群聊会话
     * <p>
     * https://qyapi.weixin.qq.com/cgi-bin/appchat/update?access_token=ACCESS_TOKEN
     * </P>
     * 参数	是否必须	说明
     * access_token	是	调用接口凭证
     * chatid	是	群聊id
     * name	否	新的群聊名。若不需更新，请忽略此参数。最多50个utf8字符，超过将截断
     * owner	否	新群主的id。若不需更新，请忽略此参数
     * add_user_list	否	添加成员的id列表
     * del_user_list	否	踢出成员的id列表
     */

    String API_POST_APPCHAT_UPDATE = API_BASE + "/appchat/update";

    /**
     * 企业微信-全量覆盖部门
     * https://qyapi.weixin.qq.com/cgi-bin/batch/replaceparty?access_token=ACCESS_TOKEN
     */
    String API_POST_BATCH_PARTY = API_BASE + "/batch/replaceparty";

    /**
     * 企业微信-全量覆盖成员
     * https://qyapi.weixin.qq.com/cgi-bin/batch/replaceuser?access_token=ACCESS_TOKEN
     */
    String API_POST_BATCH_USER = API_BASE + "/batch/replaceuser";

    /**
     * 企业微信-获取异步任务结果
     * https://qyapi.weixin.qq.com/cgi-bin/batch/getresult?access_token=ACCESS_TOKEN&jobid=JOBID
     */
    String API_GET_BATCH_GETRESULT = API_BASE + "/batch/getresult";


    /**
     * 创建发表任务
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_moment_task?access_token=ACCESS_TOKEN
     */
    String ADD_MOMENT_TASK = API_BASE + "/externalcontact/add_moment_task";


    /**
     * 上传附件资源
     * https://qyapi.weixin.qq.com/cgi-bin/media/upload_attachment?access_token=ACCESS_TOKEN&media_type=TYPE&attachment_type=1
     */
    String UPLOAD_ATTACHMENT = API_BASE + "/media/upload_attachment";

    /**
     * 获取企业全部的发表列表
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_moment_list?access_token=ACCESS_TOKEN
     */
    String GET_MOMENT_LIST = API_BASE + "/externalcontact/get_moment_list";

    /**
     * 获取客户朋友圈企业发表的列表
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_moment_task?access_token=ACCESS_TOKEN
     */
    String GET_MOMENT_TASK = API_BASE + "/externalcontact/get_moment_task";


    /**
     * 获取任务创建结果
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_moment_task_result?access_token=ACCESS_TOKEN&jobid=JOBID
     */
    String GET_MOMENT_TASK_RESULT = API_BASE + "/externalcontact/get_moment_task_result";

    /**
     * 获取客户朋友圈的互动数据
     * https://qyapi.weixin.qq.com/cgi-bin/externalcontact/get_moment_comments?access_token=ACCESS_TOKEN
     */

    String GET_MOMENT_COMMENTS = API_BASE + "/externalcontact/get_moment_comments";

    /**
     * userid转openid
     * https://qyapi.weixin.qq.com/cgi-bin/user/convert_to_openid?access_token=ACCESS_TOKEN
     */
    String POST_CONVERT_TO_OPENID = API_BASE + "/user/convert_to_openid";

    /**
     * 发放企业红包
     */
    String POST_SEND_WORK_WX_REDPACK = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendworkwxredpack";

    /**
     * 查询红包记录
     */
    String POST_QUERY_WORK_WX_REDPACK = "https://api.mch.weixin.qq.com/mmpaymkttransfers/queryworkwxredpack";
}
